#ifndef MCSFRAME_H
#define MCSFRAME_H

#include "IStreamLoadableWritable.h"
#include "MultChannel.h"
#include "McsHead.h"

class McsFrame : IStreamLoadableWritable
{
public:
    McsFrame() = default;
    ~McsFrame();

    inline std::vector<MultChannel*> GetMultChannel() { return this -> multChannels; };
    inline void SetMcsHeadPointer(const McsHead& mcsh)
    {
        mcshp = &mcsh;
        for(MultChannel* mcp : multChannels)
            delete mcp;
        multChannels.clear();
        multChannels.emplace_back(new MultChannel());
        if(mcshp->IsWithShadow())
            multChannels.emplace_back(new MultChannel());
        if(mcshp->IsWithRemap())
            multChannels.emplace_back(new MultChannel());
    }

public:
    bool TryLoad(std::istream& i) final;
    bool TryDump(std::ostream& o) final;
    bool IsDumpable() final;
private:
    std::vector<MultChannel*> multChannels;
    const McsHead* mcshp = nullptr;
};

#endif //MCSFRAME_H
